package cn.iocoder.yudao.module.call.dal.mysql.listenactionallow;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.call.dal.dataobject.listenactionallow.ListenActionAllowDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.call.controller.admin.listenactionallow.vo.*;

/**
 * 事件与动作 Mapper
 *
 * @author 数创万维
 */
@Mapper
public interface ListenActionAllowMapper extends BaseMapperX<ListenActionAllowDO> {

    default PageResult<ListenActionAllowDO> selectPage(ListenActionAllowPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ListenActionAllowDO>()
                .eqIfPresent(ListenActionAllowDO::getListen, reqVO.getListen())
                .eqIfPresent(ListenActionAllowDO::getAction, reqVO.getAction())
                .betweenIfPresent(ListenActionAllowDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ListenActionAllowDO::getId));
    }

}